package com.sgb.kjwl.viewmodel.transport;

import androidx.databinding.ObservableDouble;
import androidx.databinding.ObservableField;

import com.sgb.kjwl.model.entity.transport.GoodsInfoEntity3;
import com.sgb.kjwl.repository.TransportRepertory;
import com.sgb.kjwl.view.ui.activity.transport.CarsInfoJoinQuotedActivity3;
import com.swgk.core.base.BaseViewModel;

import java.util.ArrayList;
import java.util.List;

public class CarsInfoJoinQuotedModel3 extends BaseViewModel {

    private CarsInfoJoinQuotedActivity3 activity;
    private TransportRepertory repertory;

    public ObservableField<String> price = new ObservableField<String>();
    public ObservableField<String> distance = new ObservableField<String>();
    public ObservableField<GoodsInfoEntity3> entity = new ObservableField<>(new GoodsInfoEntity3());

    public CarsInfoJoinQuotedModel3(CarsInfoJoinQuotedActivity3 activity3, TransportRepertory repertory){
        this.activity = activity3;
        this.repertory = repertory;
    }

    public void getQuotedPriceList(){
        int page = 1;
        List<GoodsInfoEntity3> list = new ArrayList<>();
        for(int i=0;i<10;i++){
            GoodsInfoEntity3 needsEntity = new GoodsInfoEntity3();
            needsEntity.setStartStation("北京 朝阳_"+(i*page));
            needsEntity.setEndStation("上海 黄埔新区_"+(i*page));
            needsEntity.setGoodsName("金属刚才/10吨_"+(i*page));
            needsEntity.setDistances("已上架");
            needsEntity.setGoodsPrice("￥500/吨");
            needsEntity.setGoodsType("2020-3-20/高栏/15m");

            list.add(needsEntity);
        }

        activity.getQuotedPriceList(list);
    }

    public void putQuotedPrice(){
//        entity.get().getGoodsInfoId();
//        price;
//        distance;
    }
}
